<template>
    <div class="commission-detail-tem">
        <div class="commission-list-box">
            <div class="list-detail" v-for="(item,index) in detailList" :key="index" >
                <div class="left">
                    <span>{{item['apply_time']}}</span>
                </div>
                <div class="middle">
                    <img src="~assets/icons/income_down.png" alt="">
                    <div class="income">
                        <span>-</span>
                        <span>{{item['apply_price']}}</span>
                    </div>
                </div>
                <div class="right">
                    <span v-if="item.status == 0">待审核</span>
                    <span v-if="item.status == 1">已审核</span>
                    <span v-if="item.status == 2">已打款</span>
                    <span v-if="item.status == 3">未通过审核</span>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
export default {
    name:'commissionDetail',
    data(){
        return {
            detailList:[
                {date:'2018-6-28', time:'09:15', income:50, des:'二级分销佣金'},
                {date:'2018-6-28', time:'09:15', income:-50, des:'二级分销佣金'},
                {date:'2018-6-28', time:'09:15', income:100, des:'三级分销佣金'},
                {date:'2018-6-28', time:'09:15', income:-50, des:'二级分销佣金'},
                {date:'2018-6-28', time:'09:15', income:50, des:'三级分销佣金'},
                {date:'2018-6-28', time:'09:15', income:50, des:'三级分销佣金'},
            ]
        }
    },
    methods:{
        getAllMoney(){
            let that = this;
            let token = localStorage.getItem('token');
            let id = localStorage.getItem('distribution');
            let loader = that.loading();
            that.$ajax(that, 'get', that.$api.getMoneyList+id, null, token, function(res){
                if(res.data['error_code'] == 0){
                    that.detailList = res.data['msg'];
                }else{
                    that.toast(res.data['msg']);
                }
                loader.close();
            })
        }
    },
    mounted(){
        this.$store.state.tab = '提现明细';
        this.getAllMoney();
    },
    activated(){
        this.$store.state.tab = '提现明细';
        this.getAllMoney();
    }
}
</script>

<style lang='less'>
@rem:100rem;

.commission-detail-tem{
    width: 750/@rem;
    margin-top: 88/@rem;
    .commission-list-box{
        padding-top: 20/@rem;
        .list-detail{
            width: 100%;
            height: 80/@rem;
            box-sizing: border-box;
            padding: 0 30/@rem;
            display: flex;
            background: #ffffff;
            border-bottom: 1px solid #e5e5e5;
            .left{
                width: 224/@rem;
                height: 100%;
                display: flex;
                flex-direction: column;
                justify-content: center;
                align-items: flex-start;
            }
            .middle{
                width: 242/@rem;
                height: 100%;
                display: flex;
                align-items: center;
                img{
                    width: 34/@rem;
                    height: 38/@rem;
                    margin-left: 40/@rem;
                }
                .income{
                    margin-left: 20/@rem;
                    text-align: start;
                    span:nth-of-type(1){
                        margin-right: -6/@rem;
                    }
                }
            }
            .right{
                width: 224/@rem;
                height: 100%;
                display: flex;
                align-items: center;
                justify-content: flex-end;
                img{
                    height: 38/@rem;
                    width: 38/@rem;
                }
            }
        }
    }
}
</style>
